import request from '@/utils/request'

// 获取发货单列表
export function getDeliveryOrderList(params) {
  return request({
    url: '/deliveryOrders/list',
    method: 'get',
    params
  })
}

// 根据ID获取发货单详情
export function getDeliveryOrderById(id) {
  return request({
    url: `/deliveryOrders/${id}`,
    method: 'get'
  })
}

// 创建发货单
export function createDeliveryOrder(data) {
  return request({
    url: '/deliveryOrders/add',
    method: 'post',
    data
  })
}

// 更新发货单
export function updateDeliveryOrder(data) {
  return request({
    url: '/deliveryOrders/update',
    method: 'put',
    data
  })
}

// 删除发货单
export function deleteDeliveryOrder(id) {
  return request({
    url: `/deliveryOrders/delete/${id}`,
    method: 'delete'
  })
}
